package com.ucode.springboot.starter.fileStorage.provider;

import com.ucode.springboot.starter.fileStorage.FsProvider;
import com.ucode.springboot.starter.fileStorage.utils.FilePathHelper;

import cn.hutool.http.HttpUtil;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public abstract class AbstractProvider implements FsProvider{
    
    protected static Log log = LogFactory.get();
    
    protected String clientId;
    protected String urlprefix;
    protected String bucketName;
    protected String getFullPath(String file) {
        if(file.startsWith(FilePathHelper.HTTP_PREFIX) || file.startsWith(FilePathHelper.HTTPS_PREFIX)){
            return file;
        }
        return urlprefix + file;
    }
    
    @Override
    public String downloadLocal(String fileKey, String localDir) {
        return null;
    }
    
    public static void main(String[] args) {
        System.err.println(HttpUtil.downloadFile("https://p3.ssl.qhimgs0.com/sdm/360_200_60/t0168213f88d76fed25c.jpg", "G:/"));
    }
    
}
